package com.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultDTO<T> implements Serializable {
    private int code;
    private String msg;
    private T data;

    public static ResultDTO success(Object data) {
        return new ResultDTO(200, "", data);
    }

    public static ResultDTO interError(String msg) {
        return new ResultDTO(500, msg, null);
    }
}
